//加载公共样式
require('../../assets/css/common.less')

//加载自己的样式
require('./circle.less')
//引入tabbar渲染函数
const renderTabbar=require('../../utils/tabbar')
const request = require('../../utils/request')
const API = 'http://fitness.h5.itsource.cn:3701'

const urdy=document.querySelector('.urdy')
window.onload=()=>{
    renderTabbar()
    // 

    // /api/circles/opinionList获取近20条圈子动态
    request.get('/api/circles/opinionList').then(res=>{
        // console.log(res.data);
        let html=''
        let {errno,data}=res.data
        console.log(data);
        if(errno===0){
            data.forEach((v,i)=>{
                html+=`
                <div class="usname">
                <div class="avatarbox df ">
                    <div class="avatar"></div>
                    <div class="txtbox">
                        <div class="txt">用户名</div>
                        <div class="city">
                            xx省,xx市
                        </div>
                    </div>
    
                </div>
                <p class="txtp1">
                    ${v.content}
                </p>
                 <!-- 图片 -->
            <div class="pic">
                <ul class="picul df"> 
                    <li class="picli">
                        <img id="dynamicimg" src="${API+v.imgUrls}" alt="">
                    </li>
                    <li class="picli">
                        <img id="dynamicimg" src="../../assets//imgs/course-img01.jpg" alt="">
                    </li>
                    <li class="picli">
                        <img id="dynamicimg" src="../../assets//imgs/course-img01.jpg" alt="">
                    </li>
                    <li class="picli">
                        <img id="dynamicimg" src="../../assets//imgs/course-img01.jpg" alt="">
                    </li>
                    <li class="picli">
                        <img id="dynamicimg" src="../../assets//imgs/course-img01.jpg" alt="">
                    </li>
                    <li class="picli">
                        <img id="dynamicimg" src="../../assets//imgs/course-img01.jpg" alt="">
                    </li>
    
                </ul>
    
            </div>
    
            </div>
                `
            })
            urdy.innerHTML=html

        }
        // 
       
       
    })
}